package com.sky.mapper;


import com.sky.entity.User;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.time.LocalDate;
import java.time.LocalDateTime;

@Mapper
public interface UserMapper {

    /**
     * 根据openid查询用户
     * @param openid
     * @return
     */
    @Select("select * from user where openid = #{openid}")
    public User getByOpenid(String openid);


    /**
     * 插入用户数据
     * @param user
     */
    void insert(User user);

    /**
     * 根据日期统计用户数量
     */
    Integer countByDate(LocalDateTime begin , LocalDateTime end);
}
